The user datagram protocol (UDP) is a connectionless transport layer protocol, provides a transaction-oriented, simple, and unreliable information transfer service, and is applicable to an application environment in which a small amount of data is transmitted once and a reliability requirement is not high.
End-to-end UDP communication is usually implemented through forwarding of a server. In a scenario of a VPN, a VPN client (hereinafter referred to as client) does not know an external network Internet Protocol (IP) address of a peer end client, and fills an internal network IP address of the peer end client into a destination address field of a to-be-sent UDP packet. A UDP packet sent by an initiating client to a responding client is first sent to a VPN server, and then the VPN server sends the UDP packet to the responding client; and similar forwarding processing is also performed when a UDP packet is returned by the responding client.
During implementation of the present invention, the inventor finds that the prior art has at least the following problems. Because all packets between two VPN clients need to be forwarded by a VPN server, when the number of clients or the number of packets to be transferred between the clients is relatively large in the same period of time, a processing load of the VPN server increases, thereby further increasing a packet loss rate and prolonging a packet transfer delay.